package com.example.feignconsumer.controller;

import com.example.api.domain.Person;
import com.example.feignconsumer.service.HelloRemoteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *remote服务测试
 * @date 2019-4-19 11:03:15
 * @author joker
 */
@RestController
@RequestMapping("/feign/remote")
public class ConsumerRemoteController {

    @Resource
    private HelloRemoteService helloRemoteService;

    @GetMapping("/test")
    public String test(){
        StringBuilder sb = new StringBuilder();
        sb.append(helloRemoteService.hello("yangyang"));
        sb.append(helloRemoteService.hello("yangyang", 26));
        sb.append(helloRemoteService.hello(new Person(1, "yangyang", 26)));
        return sb.toString();
    }
}
